﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="index.aspx.cs" Inherits="TCS.Web.Admin.AdministrativeManage.index" %>

<%@ Register Src="~/uc/AreaTree.ascx" TagName="areatree" TagPrefix="uc3" %>
<%@ Register Src="../../Controls/copyright.ascx" TagName="copyright" TagPrefix="uc1" %>
<%@ Register Src="../../Controls/checkright.ascx" TagName="checkright" TagPrefix="uc2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>行政区管理</title>
    <style type="text/css">
        html, body
        {
            height: 100%;
        }
        body
        {
            margin-left: 0px;
            margin-top: 0px;
            margin-right: 0px;
            margin-bottom: 0px;
            padding: 0px;
        }
          .savebtn
        {
          width:69px;     
    background:url(../images/anniou_14.gif) no-repeat left top;  
    border:none; 
    height:22px; 

         }
         .cancelbtn
        {
          width:69px;      
    background:url(../images/anniou_12.gif) no-repeat left top;   
    border:none; 
    height:22px; 

            }
    </style>

    <script type="text/javascript" language="javascript">   
 function iFrameHeight() {   
//  var ifm= document.getElementById("iframepage");   
//alert("ccc");
//  var subWeb = document.frames ? document.frames["iframepage"].document : ifm.contentDocument;   
//  
//  if(ifm != null && subWeb != null) {
//     ifm.height = subWeb.body.scrollHeight;
//  }   
//alert("bbb");
//alert(document.body.scrollHeight);
//document.getElementById("tab3").height =document.body.scrollHeight;
 }   
    </script>

    <link href="../css/text.css" rel="stylesheet" type="text/css" />
</head>
<body style="height: 100%; padding: 0px; margin: 0px;">
    <form id="form1" runat="server" style="width:100%; height:100%">
    <div align="center" id="divOldCode" runat="server" visible="false">
        <table cellspacing="0" cellpadding="5" width="700" border="0">
            <tr>
                <td height="25" align="left">
                    &nbsp;&nbsp;&nbsp; 快速查询：
                    <asp:TextBox ID="txtKey" runat="server" ToolTip="关键字"></asp:TextBox>&nbsp;
                    <asp:DropDownList ID="DropField" runat="server" Width="150px" Visible="false">
                        <asp:ListItem Value="addName">名称</asp:ListItem>
                    </asp:DropDownList>
                    <asp:ImageButton ID="btn_Search" runat="server" ImageUrl="../images/button_search.GIF"
                        ToolTip="快速检索" OnClick="btn_Search_Click"></asp:ImageButton>
                </td>
            </tr>
        </table>
        <table cellspacing="0" cellpadding="5" width="700" border="0">
            <tr>
                <td align="left">
                    ○页次：<asp:Label ID="lblCurrentPage" runat="server" ForeColor="#e78a29"></asp:Label>页/<asp:Label
                        ID="lblPageCount" runat="server"></asp:Label>页，共<asp:Label ID="lblRowsCount" runat="server"
                            ForeColor="#e78a29"></asp:Label>条记录
                </td>
                <td align="right">
                    [<asp:LinkButton ID="btnFirst" runat="server" OnCommand="NavigateToPage" CommandArgument="First"
                        CommandName="Pager" Text="首 页">首 页</asp:LinkButton>] [<asp:LinkButton ID="btnPrev"
                            runat="server" OnCommand="NavigateToPage" CommandArgument="Prev" CommandName="Pager"
                            Text="上一页">上一页</asp:LinkButton>] [<asp:LinkButton ID="btnNext" runat="server" OnCommand="NavigateToPage"
                                CommandArgument="Next" CommandName="Pager" Text="下一页">下一页</asp:LinkButton>]
                    [<asp:LinkButton ID="btnLast" runat="server" OnCommand="NavigateToPage" CommandArgument="Last"
                        CommandName="Pager" Text="尾 页">尾 页</asp:LinkButton>]
                </td>
            </tr>
        </table>
        <table cellspacing="0" cellpadding="5" width="700" border="0">
            <tr>
                <td bgcolor='<%=Application[Session["Style"].ToString()+"xtable_bgcolor"]%>'>
                    <asp:GridView ID="gridView" runat="server" AutoGenerateColumns="False" Width="100%"
                        AllowPaging="True" AllowSorting="True" OnRowCreated="gridView_RowCreated" OnPageIndexChanging="gridView_PageIndexChanging"
                        OnRowDataBound="gridView_RowDataBound" CellPadding="5" BorderWidth="1px" PageSize="20"
                        OnRowDeleting="gridView_RowDeleting" OnSorting="gridView_Sorting" DataKeyNames="Addid">
                        <Columns>
                            <asp:BoundField DataField="Addid" HeaderText="序号" SortExpression="Addid" />
                            <asp:BoundField DataField="AddName" HeaderText="名称" />
                            <asp:BoundField DataField="remark" HeaderText="备注" />
                            <asp:HyperLinkField HeaderText="修改" DataNavigateUrlFields="Addid" DataNavigateUrlFormatString="modify.aspx?id={0}"
                                Text="修改" Visible="true" />
                            <asp:TemplateField HeaderText="删除" ShowHeader="False" Visible="true">
                                <ItemTemplate>
                                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Delete"
                                        OnClientClick='return confirm("您真的要删除这条记录吗？")' Text="删除"></asp:LinkButton>
                                  </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <PagerSettings Mode="NumericFirstLast" />
                        <PagerStyle HorizontalAlign="Right" VerticalAlign="Middle" />
                    </asp:GridView>
                    <asp:Label ID="Label1" runat="server" Visible="False" ForeColor="Red">没有数据！！</asp:Label>
                    <uc1:copyright ID="Copyright1" runat="server" />
                    <uc2:checkright ID="Checkright1" runat="server" />
                </td>
            </tr>
        </table>
    </div>
    <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" id="tab1">
        <tr>
            <td valign="top">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr height="25">
                        <td width="37" style="width: 37px;">
                            <img src="../images/left_15.gif" width="37" height="25" />
                        </td>
                        <td background="../images/left_17.gif">
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td style="color: #013559">
                                        当前位置：系统管理 &gt;&gt; 行政区管理
                                    </td>
                                    <td width="78" style="width: 78px;">
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td valign="top" bgcolor="#f4fbff">
                <table width="100%" border="0" cellspacing="0" cellpadding="0" id="tab3" height="100%" >
                    <tr>
                        <td width="191" valign="top">
                            <table width="100%"  border="0" cellspacing="0" cellpadding="0" id="tab2">
                                <tr height="53">
                                    <td height="53">
                                        <img src="../images/diqu_03.gif" width="191" height="53" />
                                    </td>
                                </tr>
                                <tr height="100%">
                                    <td height="100%" valign="top" style="background-image: url(../images/diqu_06.gif);
                                        background-repeat: repeat-y; padding-top: 10px; padding-left: 20px;">
                                        <uc3:areatree ID="areatree" EnabledClientScript="true" TargetFrame="iframepage"  Enabledparams="false"
                                            runat="server"   />
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td valign="top" style="padding-top: 8px;">
                            <table width="96%" border="0" align="center" cellpadding="0" cellspacing="1" bordercolorlight='<%=Application[Session["Style"].ToString()+"xtable_bordercolorlight"]%>'
                                bordercolordark='<%=Application[Session["Style"].ToString()+"xtable_bordercolordark"]%>'
                                bgcolor="#afc4e3">
                                <tr bgcolor="#e4e4e4">
                                    <td height="22" align="left" bgcolor='<%=Application[Session["Style"].ToString()+"xtable_titlebgcolor"]%>'
                                        class="bj" style="padding-left:10px;">
                                        <strong>信息添加</strong>，带有 <font>*</font> 的必须填写。
                                    </td>
                                </tr>
                                <tr>
                                    <td height="22">
                                        <table cellspacing="0" cellpadding="5" width="100%" border="0" bgcolor='<%=Application[Session["Style"].ToString()+"xtable_titlebgcolor"]%>'>
                                            <tbody>
                                                <tr>
                                                    <td width="20%" height="25" align="right" bgcolor="#F4FBFF">
                                                        上级行政区 ：
                                                    </td>
                                                    <td width="*" height="25" align="left" bgcolor="#F4FBFF">
                                                        <asp:Label ID="labarea" runat="server" Visible="true"></asp:Label>
                                                        *
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="20%" height="25" align="right" bgcolor="#F4FBFF">
                                                        行政区名称 ：
                                                    </td>
                                                    <td width="*" height="25" align="left" bgcolor="#F4FBFF">
                                                        <asp:TextBox ID="txtName" runat="server"></asp:TextBox>*
                                                    </td>
                                                </tr>
                                            </tbody>
                                        </table>
                                    </td>
                                </tr>
                                <tr>
                                    <td height="25" align="center" bgcolor="#F4FBFF" style="padding-top: 5px;">
                                        <asp:Button ID="btnAdd" runat="server" CssClass="savebtn" OnClick="btnAdd_Click"
                                            OnClientClick="return Validform();"></asp:Button><font face="宋体">&nbsp;</font>
                                        <asp:Button ID="btnCancel" runat="server" CssClass="cancelbtn" OnClick="btnCancel_Click">
                                        </asp:Button>
                                       
                                    </td>
                                </tr>
                          </table>
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="10"></td>
  </tr>
</table>

                            <table width="96%" border="0" align="center" cellpadding="0" cellspacing="1" bordercolorlight='<%=Application[Session["Style"].ToString()+"xtable_bordercolorlight"]%>'
                                bordercolordark='<%=Application[Session["Style"].ToString()+"xtable_bordercolordark"]%>'
                                bgcolor="#afc4e3">
                                <tr bgcolor="#e4e4e4">
                                    <td height="22" align="left" bgcolor='<%=Application[Session["Style"].ToString()+"xtable_titlebgcolor"]%>'
                                        class="bj"  style="padding-left:10px;">
                                        <strong>信息修改</strong>，带有 <font>*</font> 的必须填写。
                                    </td>
                                </tr>
                                <tr>
                                    <td height="22">
                                        <table cellspacing="0" cellpadding="5" width="100%" border="0" bgcolor='<%=Application[Session["Style"].ToString()+"xtable_titlebgcolor"]%>'>
                                            <tbody>
                                                <tr>
                                                    <td width="20%" height="25" align="right" bgcolor="#F4FBFF">
                                                        所选行政区 ：
                                                    </td>
                                                    <td width="*" height="25" align="left" bgcolor="#F4FBFF">
                                                        <asp:Label ID="Label2" runat="server" Visible="true"></asp:Label>
                                                        *
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="20%" height="25" align="right" bgcolor="#F4FBFF">
                                                        新行政区名称 ：
                                                    </td>
                                                    <td width="*" height="25" align="left" bgcolor="#F4FBFF">
                                                        <asp:TextBox ID="txtUpName" runat="server"></asp:TextBox>*
                                                    </td>
                                                </tr>
                                            </tbody>
                                        </table>
                                    </td>
                                </tr>
                                <tr>
                                    <td height="25" align="center" bgcolor="#F4FBFF" style="padding-top: 5px;">
                                        <asp:Button ID="btnupdate" runat="server" CssClass="savebtn" 
                                            OnClientClick="return ValidformUp();" onclick="btnupdate_Click"></asp:Button><font face="宋体">&nbsp;</font>
                                        <asp:Button ID="btnupCancel" runat="server" CssClass="cancelbtn" 
                                            onclick="btnupCancel_Click">
                                        </asp:Button>
                                    </td>
                                </tr>
                          </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>

    <script type="text/javascript"> 
 var h1 = document.getElementById('tab1').offsetHeight; 

document.getElementById('tab2').style.height = h1-90; 
 
// iFrameHeight();
    </script>
    <script type="text/javascript">
        function ValidformUp()
        {
            if(document.getElementById("txtUpName").value=="")
            {
                alert("行政区名称不能为空");
                return false;
            }
        }
         function Validform()
        {
            if(document.getElementById("txtName").value=="")
            {
                alert("行政区名称不能为空");
                return false;
            }
        }
        function Click_Node(id,text)
        {
            document.getElementById("Label2").innerText = text;
            document.getElementById("txtUpName").value = text;
            document.getElementById("labarea").innerText=text;
        }
    </script>
    </form>
</body>
</html>
